package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the CONNECTOR_STATE database table.
 * 
 */
@Entity
@Table(name="CONNECTOR_STATE")
@NamedQuery(name="ConnectorState.findAll", query="SELECT c FROM ConnectorState c")
public class ConnectorState implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(initialValue=1,allocationSize=1,name="CONNECTOR_STATE_CONNECTORID_GENERATOR",sequenceName="SEQ_10" )
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CONNECTOR_STATE_CONNECTORID_GENERATOR")
	@Column(name="CONNECTOR_ID")
	private long connectorId;

	@Column(name="CONNECTOR_DETAIL_ID_")
	private BigDecimal connectorDetailId;

	@Column(name="CONNECTOR_NAME")
	private String connectorName;

	//bi-directional many-to-one association to ConnectorStateDetail
	@OneToMany(mappedBy="connectorState")
	private List<ConnectorStateDetail> connectorStateDetails;

	public ConnectorState() {
	}

	public long getConnectorId() {
		return this.connectorId;
	}

	public void setConnectorId(long connectorId) {
		this.connectorId = connectorId;
	}

	public BigDecimal getConnectorDetailId() {
		return this.connectorDetailId;
	}

	public void setConnectorDetailId(BigDecimal connectorDetailId) {
		this.connectorDetailId = connectorDetailId;
	}

	public String getConnectorName() {
		return this.connectorName;
	}

	public void setConnectorName(String connectorName) {
		this.connectorName = connectorName;
	}

	public List<ConnectorStateDetail> getConnectorStateDetails() {
		return this.connectorStateDetails;
	}

	public void setConnectorStateDetails(List<ConnectorStateDetail> connectorStateDetails) {
		this.connectorStateDetails = connectorStateDetails;
	}

	public ConnectorStateDetail addConnectorStateDetail(ConnectorStateDetail connectorStateDetail) {
		getConnectorStateDetails().add(connectorStateDetail);
		connectorStateDetail.setConnectorState(this);

		return connectorStateDetail;
	}

	public ConnectorStateDetail removeConnectorStateDetail(ConnectorStateDetail connectorStateDetail) {
		getConnectorStateDetails().remove(connectorStateDetail);
		connectorStateDetail.setConnectorState(null);

		return connectorStateDetail;
	}

	public ConnectorState(long connectorId, String connectorName) {
		super();
		this.connectorId = connectorId;
		this.connectorName = connectorName;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "ConnectorState [connectorId=" + connectorId + ", connectorName=" + connectorName + "]";
	}
	
	public ConnectorState(List<ConnectorStateDetail> connectorStateDetails) {
		super();
		this.connectorStateDetails = connectorStateDetails;
	}
	
	
	
	
	        
	

}